package com.zbf.线程池;

import java.util.concurrent.ScheduledExecutorService;

/**
 * @author: LI-CI-GAO
 * 作者: licigao
 * 日期: 2021/8/14  11:12
 * 描述:
 */
public class MyRunable01 implements Runnable {

    private int i;

    private ScheduledExecutorService scheduledExecutorService;

    public MyRunable01(int i) {
        this.i = i;
    }

    public MyRunable01(ScheduledExecutorService scheduledExecutorService) {
        this.scheduledExecutorService = scheduledExecutorService;
    }

    @Override
    public void run() {

        TestExectors.yy++;
        if(TestExectors.yy>3){
            //
            scheduledExecutorService.shutdownNow();
            TestExectors.yy=0;
            //
            return;
        }else{
            System.out.println("======执行的次数======>"+TestExectors.yy);
            System.out.println("======执行业务=调用接口====="+i);
        }



    }
}
